package com.vf.admin.platform.service.impl;

import com.vf.admin.platform.dao.UserRoleDao;
import com.vf.admin.platform.entity.Menu;
import com.vf.admin.platform.entity.RoleMenu;
import com.vf.admin.platform.entity.UserRole;
import com.vf.admin.platform.service.UserRoleService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class UserRoleServiceImpl implements UserRoleService {
    private final Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private UserRoleDao userRoleDao;

    @Override
    public void saveOrUpdate(UserRole userRole) {
        userRoleDao.saveOrUpdate(userRole);
    }

    @Override
    public UserRole get(int userid) {
        return userRoleDao.get(userid);
    }

    @Override
    public List<UserRole> findList(Map<String, Object> paramap) {
        return userRoleDao.findList(paramap);
    }

    @Override
    public void delByUserId(int userid) {
        userRoleDao.delByUserId(userid);
    }

    @Override
    public void save(Integer userid, List<String> roleIdList) {
        userRoleDao.save(userid,roleIdList);
    }

    @Override
    public List<Menu> findMenuListByUserId(Map<String, Object> paraMap) {
        return userRoleDao.findMenuListByUserId(paraMap);
    }

    @Override
    public List<RoleMenu> findRoleMenuListByUserId(Map<String, Object> paraMap) {
        return userRoleDao.findRoleMenuListByUserId(paraMap);
    }
}
